package cn.tedu.springboot.dao;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;


//@Component 注解可以将标记的类交给Spring容器管理
//注解 可以理解是给虚拟机看的注释
//标志当前类不属于三层以内
//@Repository //标志当前类是数据层
//@Service //标志当前类是业务层
//@Controller //标志当前类是控制层
@Repository
public class UserDaoImpl implements UserDao{
    @Override
    public void save() {
        System.out.printf("测试：UserDao实现类执行了save方法~~~");
    }

    private String name;
    private Integer age;

    @Override
    public String toString() {
        return "UserDaoImpl{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public UserDaoImpl(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public UserDaoImpl() {
    }
}
